package strategy;

import windows.MainWindow;

public class Solitaire implements AlgorithmInteface {

	private SolitaireCipher sc;
	private String text;
	private String result;
	private String key;
	private MainWindow ref;
	
	public Solitaire(String text, String key, MainWindow reference) {
		this.text = text;
		this.key = key;
		ref = reference;
		sc = new SolitaireCipher(key);
	}
	
	@Override
	public void decrypt() {
		result = sc.decrypt(text);
		
		update();
	}

	@Override
	public void encrypt() {
		result = sc.encrypt(text);
		update();
	}

	@Override
	public void update() {
		ref.solitaireUpdate(result);
	}

	@Override
	public void autoDecrypt() {
		// TODO Auto-generated method stub
		
	}

}
